package tcp

import (
	"dub/app/gate/tcp/controller"
	"github.com/astaxie/beego"
	"html/template"
	"net/http"
)

func RouteAdd() {
	//404页面设置
	no_find_page := func(rw http.ResponseWriter, r *http.Request) {
		t, _ := template.New("404.html").ParseFiles(beego.BConfig.WebConfig.ViewsPath + "/404.html")
		data := make(map[string]interface{})
		data["content"] = "page not found"
		t.Execute(rw, data)
	}
	beego.ErrorHandler("404", no_find_page)

	//路由配置
	index := &controller.IndexController{}
	beego.Router("/", index, "get:Get")
	beego.Router("/:userid([1-9]|1-9][0-9]+)_:postid([1-9]|1-9][0-9]+)", index, "*:Share")
	// beego.Router("/man/advert/add", man_advert, "*:Add")
	// beego.Router("/man/advert/toup", man_advert, "*:ToUp")
	// beego.Router("/man/advert/up", man_advert, "*:Up")
	// beego.Router("/man/advert/findAdverts", man_advert, "*:FindAdverts")
	// beego.Router("/man/advert/action", man_advert, "*:Action")
}

func RegSessionGobStruct() {
}
func AddFunMap() {
}
